home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14152 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: unixg.ubc.ca!news
  2. From: jamesdf@unixg.ubc.ca (James Fairweather)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: solve equation non-recursively
  5. Date: Fri, 29 Mar 1996 05:56:03 GMT
  6. Organization: University of British Columbia
  7. Message-ID: <315b7adc.32382490@news.ucs.ubc.ca>
  8. References: <4jfjfv$q7b@nntp.crl.com>
  9. NNTP-Posting-Host: srtb0411a01.resnet.ubc.ca
  10. X-Newsreader: Forte Agent .99d/32.182
  11.  
  12. On Fri, 29 Mar 1996 02:43:01 GMT, bk077@freenet.hsc.colorado.edu (ted)
  13. wrote:
  14.  
  15. >i am trying to write a program to solve a 1st order equation but it
  16. >example;
  17. > x1, x2, x3 =  {23, 44, 55}
  18. >              Z = 1000
  19. >
  20. >would look like:  23A+44B+55C = 1000,
  21. >i need to solve for A, B, and C.
  22.  
  23. I think you must have made a mistake here.  You have n-1 degrees of
  24. freedom when solving this linear equation.  Just set the first n-1
  25. coefficients to 0 and solve for the nth one.  Done.  In your example, 
  26. A = 0, B = 0, C = 1000/55 is a valid solution.
  27. ---
  28. James Fairweather
  29. 4th year Comp. Eng, UBC
  30. Vancouver, BC, Canada
  31. jamesdf@unixg.ubc.ca
  32. 604.228.2269
  33.